#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;//strchr   strncpy

char xx[256],zx[256];

void work(char *sx,char *sz){
	int len = strlen(sx);
	if(len == 0)	return;
	if(len == 1){
		printf("%c",sx[0]);
		return;
	}
	char newx[256],newz[256];
	if(len > 1){
		char *k = strchr(sz,sx[0]);
		int p = k - sz;
		strncpy(newx,sx+1,p);
		strncpy(newz,sz,p);
		newx[p] = 0;
		newz[p] = 0;
		work(newx,newz);
		strncpy(newx,sx+1+p,len-p-1);
		strncpy(newz,sz+1+p,len-p-1);
		newx[len-p-1] = 0;
		newz[len-p-1] = 0;
		work(newx,newz);
		printf("%c",sx[0]);
	}
}

int main(){
	scanf("%s %s",xx,zx);
	work(xx,zx);
	return 0;
}

